﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace EmprestaAE.MVVM.ViewModel
{
    public class VMCommand : ICommand
    {
        private Action<object> action;
        public event EventHandler CanExecuteChanged;
        private VMCommand AddBorrowingCommand;

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public void Execute(object parameter)
        {
            if (action != null) action(parameter);
        }

        public VMCommand(Action<object> param) { this.action = param; }

        public VMCommand(VMCommand AddBorrowingCommand)
        {
            // TODO: Complete member initialization
            this.AddBorrowingCommand = AddBorrowingCommand;
        }
    }
}
